<template>
  <view>
    login
    <u-button type="primary" @click="login">
      登录
    </u-button>
  </view>
</template>

<script>
  import loginApi from '@/api/common';
  import store from '@/store/index.js';
  export default {
    data() {
      return {

      }
    },
    methods: {
      login() {
        loginApi.login({
            "username": 'hcadmin',
            "password": 'hc123456',
            "verifyCode":"0000",
            "loginType":2
          })
          .then((res) => {
            // 写入本地缓存
            uni.setStorage({
              key: 'zk_token',
              data: res.result.zkToken
            });
            uni.navigateBack()
            // uni.navigateTo({
            //   url: 'pages/index/index'
            // })
          })
      }
    }
  }
</script>

<style>

</style>
